import axios from '../utils/index';
import { Pat } from '@/typings/request';
const settingsApi = {
    uploadFile(data: FormData, callback: (T: any) => void) {
        axios
            .post(`/common/upload/file`, data, { timeout: 120000 })
            .then(res => {
                callback(res.data);
            })
            .catch(err => {
                callback(err);
            });
    },
    versionAdd(data: Pat, callback: (T: any) => void) {
        axios
            .post(`/oa/version`, data)
            .then(res => {
                callback(res.data);
            })
            .catch(err => {
                callback(err);
            });
    },
    versionList(params: Pat, callback: (T: any) => void) {
        axios
            .get(`/oa/version`, {
                params,
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded',
                },
            })
            .then(res => {
                callback(res.data);
            })
            .catch(err => {
                callback(err);
            });
    },
};
export default settingsApi;
